/**************************************************************************************
*
*	Copyright (C) 2009 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	-	RenderEntryList.cpp
*
*	Comments	-	See RenderEntryList.h
*
**************************************************************************************/

#include "../Include/RenderEntryList.h"

namespace Pulse
{
	RenderEntryList::~RenderEntryList( void )
	{
		ClearRenderEntries();
	}

	void RenderEntryList::ClearRenderEntries( void )
	{
		SIZE_T numEntries = m_renderEntries.GetSize();

		for ( SIZE_T i = 0; i < numEntries; ++i )
		{
			delete m_renderEntries[i];
		}

		m_renderEntries.Clear();
	}

	void RenderEntryList::AddRenderEntry( RenderEntry *pEntry )
	{
		if ( pEntry )
		{
			m_renderEntries.PushBack( pEntry );
		}
	}

	RenderEntry ** RenderEntryList::GetRenderEntries( void )
	{
		if ( GetNumEntries() )
		{
			return &m_renderEntries[0];
		}

		return PSX_NULL;
	}


}